# Maintainer: Eli Schwartz <eschwartz@archlinux.org>
# Contributor: Balló György <ballogyor+arch at gmail dot com>

_pkgname=python3-xapp
pkgname=python-xapp
pkgver=2.4.0
pkgrel=2
pkgdesc="Python Xapp Library"
arch=('any')
url="https://github.com/linuxmint/${_pkgname}"
license=('LGPL')
depends=('python' 'python-psutil')
makedepends=('meson')
source=("${_pkgname}-${pkgver}.tar.gz::${url}/archive/${pkgver}.tar.gz")
sha512sums=('7c9afabbc810ffe878e831f7e1ff585ce49abc6d1db3d4ea70deb6630e2bb18f61ded31ae0e075cccae2283cac50b3440204a586f844ba9ee9cfbcb572bf7573')

build(){
  meson build ${_pkgname}-${pkgver} \
    --prefix=/usr
  meson compile -C build
}

package() {
  meson install -C build --destdir="${pkgdir}"

  # compile Python bytecode
  python -m compileall -d / "$pkgdir"/usr/lib
  python -O -m compileall -d / "$pkgdir"/usr/lib
}
